#include "clight.h"

CLight::CLight(CPoint3f pos, float r, float g, float b)
{
	this->pos = pos;
	this->red = r;
	this->green = g;
	this->blue = b;
}

void CLight::paint()
{
    glPushMatrix();
            glTranslatef(this->pos.GetX(), this->pos.GetY(), this->pos.GetZ());
            GLUquadric *quadric;
            quadric = gluNewQuadric();
            gluQuadricDrawStyle(quadric, GLU_FILL);
            gluQuadricNormals(quadric, GLU_SMOOTH);
            /* If we ever changed/used the texture or orientation state
            of quadObj, we'd need to change it to the defaults here
            with gluQuadricTexture and/or gluQuadricOrientation. */
            gluSphere(quadric, 10, 32, 32);

            glDisable(GL_LIGHTING);
            glColor3f(this->red, this->green, this->blue);
            glBegin(GL_LINES);
                    glVertex3f(-50.0f, 0.0f, 0.0f);
                    glVertex3f(50.0f, 0.0f, 0.0f);
            glEnd();

            glBegin(GL_LINES);
                    glVertex3f(0.0f, -50.0f, 0.0f);
                    glVertex3f(0.0f, 50.0f, 0.0f);
            glEnd();

            glBegin(GL_LINES);
                    glVertex3f(0.0f, 0.0f, -50.0f);
                    glVertex3f(0.0f, 0.0f, 50.0f);
            glEnd();
            glEnable(GL_LIGHTING);

    glPopMatrix();
}
